﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpModelInterface.h"

namespace gcmp
{
    class IDocument;

    /// \brief Element对象关系
    FINAL_INTERFACE class GCMP_MODEL_INTERFACE_EXPORT IElementRelationships
    {
    public:
        /// \brief 析构函数
        virtual ~IElementRelationships() {};

    public:
        /// \brief 获取文档的Element对象关系
        /// \pDocument 文档
        /// \return Element对象关系
        static const IElementRelationships* GetElementRelationships(const IDocument* pDocument);

        /// \brief 获取文档的Element对象关系
        /// \pDocument 文档
        /// \return Element对象关系
        static IElementRelationships* GetElementRelationshipsFW(IDocument* pDocument);

        /// \brief 获取Element对象的强依赖父亲
        /// \elemmentId Element对象的ID
        /// \return Element对象的强依赖父亲ID集合
        virtual const std::set<ElementId>& GetStrongParents(const ElementId& elemmentId) = 0;

        /// \brief 获取Element对象的弱依赖父亲
        /// \elemmentId Element对象的ID
        /// \return Element对象的弱依赖父亲ID集合
        virtual const std::set<ElementId>& GetWeakParents(const ElementId& elemmentId) = 0;

        /// \brief 获取Element对象的强依赖子Element
        /// \elemmentId Element对象的ID
        /// \return Element对象的强依赖子ElementId集合
        virtual const std::set<ElementId>& GetStrongChildren(const ElementId& elemmentId) = 0;

        /// \brief 获取Element对象的弱依赖子Element
        /// \elemmentId Element对象的ID
        /// \return Element对象的弱依赖子ElementId集合
        virtual const std::set<ElementId>& GetWeakChildren(const ElementId& elemmentId) = 0;
    };
}




